package com.dongway.netcondition.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dongway.core.common.Paginator;
import com.dongway.core.web.AbstractBaseController;
import com.dongway.netcondition.criteria.DevCriteria;
import com.dongway.netcondition.dto.DevStateDTO;
import com.dongway.netcondition.service.DevNetStateService;

@Controller
public class CheckController extends AbstractBaseController {

    @Autowired
    private DevNetStateService devStateService;


    @RequestMapping("/check.htm")
    public String check(Paginator paginator, ModelMap modelMap) {
    	List<DevStateDTO> list = devStateService.allOrderByDevId(paginator);
        modelMap.put("devNetStates", list);
        modelMap.put("paginator", paginator);
        return "net/check";
    }
    
    
    @RequestMapping("/check.json")
    public String checkJson(Paginator paginator, DevCriteria criteria, ModelMap modelMap) {
        List<DevStateDTO> list = devStateService.allOrderByDevId(paginator);
        modelMap.put("devNetStates", list);
        modelMap.put("paginator", paginator);
        return "net/check/check";
    }
}
